import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Index from '@/views/index.vue'
import FindHouse from '@/views/findHouse.vue'
import News from '@/views/news.vue'
import User from '@/views/user.vue'
import City from '@/views/city.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      { path: '/index', component: Index },
      { path: '/findhouse', component: FindHouse },
      { path: '/news', component: News },
      { path: '/user', component: User }
    ]
  },
  { path: '/city', component: City }
]

const router = new VueRouter({
  routes
})

export default router
